package com.easy.service.impl;

import com.easy.bean.Department;
import com.easy.dao.IDepartmentDao;
import com.easy.service.IDepartmentService;
import com.easy.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentService implements IDepartmentService {
    @Autowired
    IDepartmentDao dao;

    @Override
    public List<Department> getDepartment(Department department, Page page) {
        return dao.getDepartment(department,page);
    }

    @Override
    public int addDepartment(Department department) {
        return dao.addDepartment(department);
    }

    @Override
    public int editDepartment(Department department) {
        int count=dao.editDepartment(department);
        return count;
    }

    @Override
    public Department getDepartmentById(int id) {
        return dao.getDepartmentById(id);
    }

    @Override
    public int delDepartment(int id) {
        return 0;
    }

    @Override
    public int getCount(Department department) {
        return dao.getCount(department);
    }
}
